﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{
    /// <summary>
    /// 盖梁类别
    /// </summary>
    public enum ECrossBeamType
    {
        None = 0,
        BPTM2U = 109,
        BPTM1 = 110,
        BPTM1S = 111,
        BPTM1U = 112,
        BPTM1T = 113,
        BPTM2 = 120,
        BPTM2S = 121,
        BPTM2T = 122,
        BPTM3=130,
        BPTM3S = 131,
        BPTM3U = 132,
        BPTM3T = 133,
        BPTE2 = 154,
        BPTE3 = 155,
        BPTE32 = 156,
        BPTL2 = 157,
        BPL2 = 358,
        BPME4 = 10,
        BPE12 = 11,
        BPE21 = 12,
        BPE22 = 13,
        BPE32 = 14,
        BPE11 = 15,
        BPE13 = 16,
        BPE14 = 17,
        BPE23 = 18,
        BPE31 = 19,
        BPM1 = 159,
        BPTE7 = 160,
        BPTL1 = 161,
        BPME3 = 162,
    }

    /// <summary>
    /// 桩基类别
    /// </summary>
    public enum EPileType
    {
        None = 0,
        Type1,
        Type2,
        Type3,
        Type4,
        Type5,
        Type6,
        Type7,
        Type1T,
        Type600, // Mokahali 桩基
    }

    /// <summary>
    /// 承台类别
    /// </summary>
    public enum EFootingType
    {
        #region 5-10,10.01-15...
        None,
        FPME11 = 1,
        FPME12 = 2,
        FPME41 = 21,
        FPME42 = 22,
        F1PME5 = 31,
        F2PME5 = 32,
        FPTM3S = 131,
        FPTM2S = 121,
        F1PTM2 = 120,
        F2PTM2 = 1201,
        F1PTM3=130,
        FPTM3U = 132,
        FPTM1 = 110,
        FPTM1S = 111,
        F1PTM1U = 112,
        F2PTM1U = 1121,
        F1PTM1T=113,
        F2PTM1T,
        F1PTM2T,
        F2PTM2T,
        F1PTM3T = 133,
        F2PTM3T = 1331,
        F2PTM3=134,
        FPM1 = 159,
        FPTM4 = 1001,
        FPTM2U = 1002,

        FPTE2 = 154,
        FPTE3 = 155,
        FPTE32 = 156,
        FPTL2 = 157,
        FPTE7 = 160,
        F1PTL1 = 161,
        F2PTL1 = 1611,
        F1PME3 = 162,
        F2PME3 = 1621,
        #endregion
        #region 3-6,6.01-9,9.01-12...
        // PE墩柱编号规范：3+数字序号，如PE12编号为“312”    
        FPE11 = 311,
        FPE12 = 312,
        FPE13 = 313,
        FPE14 = 314,
        //FPE21 = 321,
        FPE21A = 3210,
        FPE21B = 3211,
        FPE22 = 322,
        FPE23 = 323,
        FPE31 = 331,
        FPE32 = 332,
        FPL2 = 358,
        FPE42 = 333,
        #endregion
        #region MHK
        FMHK = 400,
        #endregion
    }

    /// <summary>
    /// 墩柱类别
    /// </summary>
    public enum eColumnType
    {
        None = 0,
        CPTM1 = 110,
        CPTM1S = 111,
        CPTM1U = 112,
        CPTM1T = 113,
        CPTM2 = 120,
        CPTM2T = 122,
        CPTM2S = 121,
        CPTM3=130,
        CPTM3U = 132,
        CPTM3S = 131,
        CPTM3T = 133,
        CPME41 = 21,
        CPME42 = 22,
        // PE墩柱编号规范：3+数字序号，如PE12编号为“312”
        CPE12 = 312,
        CPE21A = 3210,
        CPE21B = 3211,
        CPE22 = 322,
        CPE31 = 331,
        CPE32 = 332,
        CPE42 = 342,
        CPTE2 = 154,
        CPTE3 = 155,
        CPTE32 = 156,
        CPTL2 = 157,
        CPL2 = 358,
        CPM1 = 159,
        CPTE7 = 160,
        C1PTL1 = 161,
        C2PTL1 = 1611,
        CPME31 = 162,
        CPME32 = 1621,
    }
    /// <summary>
    /// 根据墩高分类
    /// </summary>
    public enum eSubType
    {
        None = 0,
        A = 1,//墩高5.00-10.00     3.00-6.00
        B = 2,//墩高10.01-15.00    6.01-9.00

        C = 3,//墩高15.01-20.00    9.01-12.00

        D = 4,//墩高20.01-25.00    12.01-15.00
        E = 5,//备用25.01-30.00    15.01-18.00
        F = 6,//备用               18.01-21.00
        G = 7,//备用               21.01-24.00
        H = 8,//备用               24.01-27.00
        I = 9,//备用               27.01-30.00
        J = 10,//备用              30.01-33.00
        K = 11,//备用              33.01-37.00
        BM = 12,
        CM = 13,
        HM = 14,//备用               24.01-27.00
        IM = 15,//备用               27.01-30.00
    };

    /// <summary>
    /// 混泥土强度
    /// </summary>
    public enum eConcreteClass
    {
        None = 0,
        C30 = 0,
        C35 = 35,
        C45 = 45,
        C50 = 50
    };

    /// <summary>
    /// 预应力钢束类别
    /// </summary>
    public enum eStrandClass
    {
        S152 = 152,
    };
    /// <summary>
    /// 直径
    /// </summary>
    public enum eDB
    {
        None = 0, DB10 = 10, DB12 = 12, DB16 = 16,
        DB20 = 20, DB22 = 22, DB25 = 25, DB28 = 28, DB32 = 32
    };


    /// <summary>
    /// Ubolt计数器，所有构件均含有一个；
    /// </summary>
    public class UBoltCounter
    {
        public Dictionary<eDB, int> UBoltNum;
        public UBoltCounter()
        {
            UBoltNum = new Dictionary<eDB, int>()
            {
                { eDB.DB10,0 },
                { eDB.DB12,0 },
                { eDB.DB16,0 },
                { eDB.DB20,0 },
                 { eDB.DB22,0 },
                { eDB.DB25,0 },
                { eDB.DB28,0 },
                { eDB.DB32,0 },
            };
        }
    }

    public class EXNumber
    {
        public Dictionary<string, double> exNumber;
        public EXNumber()
        {
            exNumber = new Dictionary<string, double>()
            {
                {"A",0 },
                {"B",0 },
                {"C",0 },
                {"D",0 },
                {"E",0 },
                {"R",0 },
            };
        }
    }
    public enum eShapeType
    {
        None = 0,
        StAB = 1,// 矩形箍筋
        StABCD = 2,// 6边形箍筋
        MA = 3, //Main A A型直筋，具体类型示意见表
        MB = 4, //Main B B型直筋，具体类型示意见表
        MAB, //Main A AB型直筋，A>B
        MBA, //Main A AB型直筋，B>A
        MABC, //Main A ABC型直筋，A+B+C
        M2ABCD, //Main A ABC型直筋，A+B+C

        Pile1a,
        Pile1b,
        Pile, // 桩基无搭接直线钢筋
        PileB, // 桩基底部搭接直线钢筋
        PileT, // 桩基顶部搭接直线钢筋
        PileBT, // 桩基两端搭接直线钢筋
        //PileMZa,// 桩基顶部搭接螺旋钢筋
        PileMZB,// 桩基底部搭接螺旋钢筋
        PileMZBT,// 桩基两端搭接螺旋钢筋
        //PileMZaM,// 中间加密区桩基顶部搭接螺旋钢筋
        //PileMZbM,// 中间加密区桩基底部搭接螺旋钢筋
        PileMZBTM,// 中间加密区桩基两端搭接螺旋钢筋
        PileMZTB,// 底部加密区桩基顶部搭接螺旋钢筋
        //PileMZbB,// 底部加密区桩基底部搭接螺旋钢筋
        PileMZBTB,// 底部加密区桩基两端搭接螺旋钢筋
        PileC,// 底部加密区桩基两端搭接螺旋钢筋
        MG, //两端为标准90°勾的C钢筋,具体类型示意见表
        MY, //圆圈箍筋，默认无焊接，计算长度时需额外添加焊接长度
        MZ, //桩基螺旋钢筋
        MI, //两端弯起长度不一致（可以一致）情况的C钢筋,大样编号9
        MHX, //预埋承台内的墩身主筋。
        MHXL1, //预埋承台内的墩身主筋。
        MHXL2, //预埋承台内的墩身主筋。
        MHXS, //预埋承台内的墩身主筋。
        MHXT,
        MHXA, //预埋承台内的墩身主筋。
        MHXe,// 起步筋，向外
        MHXi,// 起步筋，向内
        MO135,// 矩形箍筋
        MO,// 矩形箍筋
        MRO,// 匝道菱形箍筋
        MR,// 匝道菱形箍筋
        ML,// 墩柱锚固盖梁，L型避让钢筋；
        MLSD,// 墩柱锚固盖梁，闪电+L型避让钢筋；
        MLADD,// L型(A+B)钢筋；
        MLS,// 墩柱锚固盖梁，直线锚固钢筋；
        MLZ,// 墩柱锚固盖梁，L型闪电避让钢筋；
        MSZ,// 墩柱锚固盖梁，直线闪电避让钢筋；
        MSZR,// 墩柱锚固盖梁，直线闪电避让钢筋；
        MIXA,
        MIXAR,
        MIXB,
        MIXC,
        MIXCR,
        MU, // PTM盖梁下层主筋，非标准180度弯钩；
        MUR, // PTM盖梁下层主筋；
        MUC, // PTM盖梁下层主筋；
        MCD,
        MCL,//左
        MCR,//右
        MCT,//上
        MCB,//下
        MK,// PE花瓶
        MKR,// PE花瓶加强
        MKR1,// 起步PE花瓶
        MKR2,// 起步PE花瓶
        MKAD1,// 起步PE花瓶
        MKAD2,// 起步PE花瓶
        MKAB,//  PE花瓶加强
        MKL,// PE花瓶带起步筋
        MKLN,// PE花瓶带起步筋
        MKLBM,// PE花瓶带起步筋
        MKLM,// PE花瓶带起步筋
        MPC,//波纹管冲突问题钢筋大样
        MLL,
        MLR,
        MDR,
        MRC,
        MCO,
        MCC,
        MRLC,
        MAN,
        MWAVE,// 预制板波浪钢筋

        MUN,//U型两侧不等长
        MUL,//U型带弯钩
        MUA,//U型带直线

        MAR,//带R A A型直筋
        MABR, //带R A AB型直筋，A>B
        MBAR, //带R  A AB型直筋，B>A
        MABCR, //带R A ABC型直筋，A+B+C
        MAU,

        MLABCD,
        MCI,
    }

    /// <summary>
    /// 预应力张拉方式，单端，双端
    /// </summary>
    public enum eForceType
    {
        OneEnd = 1,
        BothEnd = 2,
    };

    /// <summary>
    /// 桥跨端头类型
    /// </summary>
    public enum eEndType
    {
        LinkSlab = 1,
        ExpansionJoint = 2,
    }

    public class PublicEnumItems
    {
        public static int GeteDBData(string dataType)
        {
            return (int)Enum.Parse(typeof(eDB), dataType);
        }
    }
}
